package Demo;

public class Demo1 {
    public static void main(String[] args) {
        int[] arr1 = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9};
        for (int i = 0; i < arr1.length / 2; i++) {//数组倒置
            int cen;
            cen = arr1[i];
            arr1[i] = arr1[arr1.length - 1 - i];
            arr1[arr1.length - 1 - i] = cen;
        }
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i] + "\t");

        }
        System.out.println("\n");
        System.out.println("++++++++++++++++++++++++++++++++++++++");
        int[] qq = new int[]{1, 2, 3, 55, 66, 99, 12, 666, 99};
        for (int i = 0; i < qq.length - 1; i++) {//冒泡排序
            for (int j = 0; j < qq.length - i - 1; j++) {
                int a;
                if (qq[j] > qq[j + 1]) {
                    a = qq[j];
                    qq[j] = qq[j + 1];
                    qq[j + 1] = a;

                }
            }
        }
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(qq[i] + "\t");
            System.out.println();
        }


    }
}


